package ar.com.ctrln.persistence.dao.sistema.principal;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import ar.com.ctrln.persistence.dao.AbstractHibernateDao;
import ar.com.ctrln.persistence.model.sistema.dashboardPpal.Alerta;


@Repository("alertaDao")
public class HibernateAlertaDao extends AbstractHibernateDao<Alerta> implements AlertaDao {

	@Override
	@Transactional(readOnly = true)
	public Alerta findAlertaById(long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Alerta> alertaReves() {
		Query q = getSession().createQuery("from Alerta i order by i.id desc").setMaxResults(10);
		return (List<Alerta>)q.list();
	}

}
